package com.lupan.guice.bindings.instanceBinding;

import com.google.inject.Inject;
import com.google.inject.name.Named;
import com.lupan.guice.bindings.CreditCardProcessor;
import com.lupan.guice.bindings.TransactionLog;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

/**
 * 说明:
 *
 * @author lupan
 * @version 2016/9/19 0019 下午 10:14
 */
public class BillingService3 {

    private static final Logger logger = LoggerFactory.getLogger(BillingService3.class);

    @Inject
    private CreditCardProcessor processor;
    @Inject
    private TransactionLog log;
    @Named("url")
    @Inject
    private String url;


    public void charge(){
        logger.info("{}",processor.charge());
        logger.info("{}",log.log());
    }

    public String getUrl(){
        return this.url;
    }
}
